-
-
Notifications
You must be signed in to change notification settings - Fork 146
fix miscellaneous translations + build warnings #1934
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
…ishTestimony component
…update usage in ReportModal component
…ge translation key
jicruz96
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Screenshots next to code as proof that display remains unchanged. All screenshots taking in dev environment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This component was translated for completeness's sake but is unused in the current app.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know how to access this page. No admin account.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be tested when running locally against Docker - there's an admin account in the Firebase Emulator UI's Auth page you can use. When signed in with that account, just go to localhost:3000/admin to find all our admin-only features.
We can also get you set up with an admin account on the dev site - remind me at hack night with the email/uid of the account you want to be an admin.
| import { useTranslation } from "next-i18next" | ||
|
|
||
| const policies = ["copyright", "privacy-policy", "code-of-conduct"] as const | ||
| const policies = ["privacy-policy", "copyright", "code-of-conduct"] as const | ||
| export type Policy = (typeof policies)[number] | ||
|
|
||
| export default function PolicyPage({ | ||
| policy = "privacy-policy" | ||
| }: { | ||
| policy?: Policy | ||
| }) { | ||
| const handleOnClick = (p: Policy) => { | ||
| Router.push(`/policies/${p}`) | ||
| } | ||
|
|
||
| const { t } = useTranslation("policies") | ||
| return ( | ||
| <Container fluid className={style.policyContent}> | ||
| <h1>Policies</h1> | ||
| <h1>{t("title")}</h1> | ||
| <Stack direction="horizontal"> | ||
| <Button | ||
| className={`${ | ||
| style[policy === "privacy-policy" ? "currentTab" : "tab"] | ||
| }`} | ||
| id="privacy-policy" | ||
| onClick={e => handleOnClick("privacy-policy")} | ||
| > | ||
| Privacy <br /> Policy | ||
| </Button> | ||
| <Button | ||
| className={`${style[policy === "copyright" ? "currentTab" : "tab"]}`} | ||
| id="copyright" | ||
| onClick={e => handleOnClick("copyright")} | ||
| > | ||
| Terms of Service <br /> | ||
| </Button> | ||
|
|
||
| <Button | ||
| className={`${ | ||
| style[policy === "code-of-conduct" ? "currentTab" : "tab"] | ||
| }`} | ||
| id="code-of-conduct" | ||
| onClick={e => handleOnClick("code-of-conduct")} | ||
| > | ||
| Code of <br /> Conduct | ||
| </Button> | ||
| {policies.map(p => ( | ||
| <Button | ||
| className={`${style[policy === p ? "currentTab" : "tab"]}`} | ||
| id={p} | ||
| key={p} | ||
| onClick={() => Router.push(`/policies/${p}`)} | ||
| > | ||
| {t(`tabs.${p}`)} | ||
| </Button> | ||
| ))} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| } | ||
|
|
||
| const WrappedApp = appWithTranslation(App) | ||
| const WrappedApp = appWithTranslation(App, nextI18NextConfig) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting 🤔 - were we not actually using the config we've had for years?
Mephistic
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great - just want to wait to merge until after the Oct 1 event.
The Node 20/22 thing in Vercel is a known error, but it doesn't seem to be causing any issues yet, so it's been a lower priority. Presumably at some point we'll move everything up to Node 22, just not sure where that fits in our roadmap.
Mephistic
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - thanks for taking this on!
* Merge pull request #1944 from mertbagt/sync-playback-to-transcription Sync playback to transcription * fix(notifications): Adding Daily option to notification settings dropdown. This should be the last piece needed to roll out the Daily frequency option that was recently added to the backend (#1957) * Debug bill detail page translations (#1953) * refactor CardTitle to be generic; update usage (#1942) * refactor CardTitle to be generic; update usage * ran prettier --------- Co-authored-by: Merritt Baggett <[email protected]> * remove redundant font-family declarations (#1926) * create Browse Hearings page and hearings search index * merge new changes * create hearings search index * update events type * rename base -> shared * remove redundant file * fix miscellaneous translations + build warnings (#1934) * misc translations intermediary commit * silence react-hooks/exhaustive-deps warnings * silence build warnings * format files * fix testimony counts translation string * debug policy page translation * Add key to policy tabs * fix i18n key bug in PolicyPage values section * simplify translation approach for ArchiveTestimonyConfirmation * refactor translation keys in QuickInfo component for consistency and clarity * add errorLabel translation to testimony.json and update usage in PublishTestimony component * add character count translation to reportModal in testimony.json and update usage in ReportModal component * update error handling in PublishTestimony component to use errorMessage translation key * update publish button text to use new translation key for conditional rendering * remove unnecessary whitespace in CopyButton label in SelectRecipients component * fix publish button translation string * fix edit limit notice * refactor HearingHit component to use styled card and avoid nested anchor tags * add SearchPage stories and mock instant search adapter * Minor updates to goals and mission (#1962) * update mission * normal use of hyperlink not working with this translation file --------- Co-authored-by: Merritt Baggett <[email protected]> * contain hyperlink size * bills under consideration * refactored See all * display bills in agenda * handle BillsInAgenda when undefined * simply see members button * voting modal * handle recommended actions * Create search component for hearing page (#1954) * Create search component for hearing page * Add stying and also transcription for hearing page * Add clean search button * Backfill Hearing Transcriptions Script (#1951) * Initial version of backfill * Add bucketName arguments to specify Firebase bucket * Change to sequential processing instead of parallel to prevent memory overload * Add limit to prevent transcription overload * cleanup * merge translations * tweak to match figma * sync to figma * Fix test failure (#1968) * Use setup-firebase instead of the old one (#1958) * Use setup-firebase * Formatting * Use the same version node setup code as prod * Pin w9jds/setup-firebase * Use the correct inputs to setup_firebase (#1969) * removed unprovable claim * removed no recommendations * modal vote question * top level vote results * added branch to member list * member line data * inner modal styling * cleanup * cleanup 2 * prettier * prettier attempt 2 * cleanup3 * Update tools version in deployment workflow (#1970) [fix] Updating the Firebase Tools version for the Python deploy actions - We accidentally used 13.8.0 in the python flow instead of the 13.18.0 used in the typescript flow. * ... (#1973) * Add court sessions data structure and update hearing components to use chairNames * chore(firestore): Update firestore indexes to reflect new index for the query that backfills Hearings into Typesense (#1977) * tweaks (#1979) * Browse hearings sort patch (#1980) * fix translation string typo * refactor(HearingSearch): update sorting options and improve hearing date filters * refactor(HearingSearch): streamline sorting options and update translation strings * Added overflow-wrap: break-word to testimony description. (#1976) * Add summary backfill (#1948) * Initial commit * Fill out TODOs * Move it so it works * Update documentation on summary script * Update * Remove temporary exit * Progress * Update with new CSV writer * Minor writerow updates * Minor clean-up * Name the tests * Address feedback * Address feedback * Use normalize_summary for document creation (#1981) * Use normalize_summary for document creation * minor linter issue * increase memory for functions * Push normalize_summary after the LLM API call to avoid having devs to remember * Not needed * Removed internal flexbox for footer base; changed to div which occupies full row. * update README.md * update .all-contributorsrc * More Sidebar Tweaks (#1985) * tweaks * additional changes * cleanup * Debugging broken browse-bills and testimony playwright tests (#1972) * Debugging broken browse-bills and testimony playwright tests * re-submitting after running linting --------- Co-authored-by: nssensalo <[email protected]> * change View hearing votes to View Committee Votes (#1997) * Navbar browse overlap fix (#1987) * Fixed Navbar overlap and saved space * Switched extraneous <Nav> elements to px-2 to slightly reduce padding * Removed invisible hearings container * Changed navbar to right justified (excluding Maple icon) * Updated to match Prettier suggestions * chore(engine): Fix node engine to major version 20 to avoid node 24 dependency issues (#2002) * Added transcription download; moved transcription components to components/hearing/transcription.js * Fixed commit errors & prettifying. * Removed unnecessary imports. * Changed hearing search order. * Transcript auto-scrolls to match video playback (#2007) * Transcript auto-scrolls to match video playback * Fixed error at end of video * Prettify * Remove flask API from firebase functions (#1998) * Remove flask API from firebase functions * Add top-level comment to main.py * Bill to hearing mapping (#1995) * fix translation string typo * refactor(HearingSearch): update sorting options and improve hearing date filters * refactor(HearingSearch): streamline sorting options and update translation strings * Bill-to-Hearings mapping * Added info badge to unavailable videos (#2008) * Added hearing result text * Switched to locale text * Pluralize * Update Hearing Type Definition (#2009) * fix(hearing): Updating hearing type to reflect data we're getting that is missing Hearing properties - it seems that Name, and HearingHost.GeneralCourtNumber/CommitteeCode are sometimes missing * chore(runtypes): Updating runtypes version to 6.6.0 to pick up the new verbose error messages * add hover behavior to transcription timestamps (#2012) * add hover behavior to transcription timestamps * cleanup * Transcript search fix (#2014) * Fixed transcript search bugs * Prettify * Bill to Hearing Links (#2000) * lay down basic hearing-link layout * breakpoints * conflict resolution 2 * add hearingIds to bill type * add translations * modal foundation * modal title * hearing details * fixed internal links * translations * translation * refactor hearingIds * refactor hearingIds * resolve dupliucate hearingIds * Set up ruff, add CI check (#1996) * Set up ruff, add CI check * We should also run pytest * Run prettier on repo-checks.yml * fix(types): Updating HearingContent's PrimarySponsor type to account for the fact that the Id can be null (if the primary sponsor is not a member of the legislature) (#2016) * More hearing types (#2018) * fix(hearing): Update hearing types - location can also sometimes be missing * fix(yarn): Remove unneeded package-lock.json, add package-lock.json to gitignore (because we use yarn), and remove yarn from the package.json deps list * Fix Bill/Hearing Sync Logic (#2019) * fix(hearings): Update bill/hearing sync so that bills are only synced with hearings from the same general court. This was not an issue previously because we only scraped hearings from the current general court, but we removed that filter to accommodate the backfill of the bill/hearing mappings and accidentally broke that logic. We now will fetch the court of the bills at the start, build a map to keep track of the bill/court linkage, and use that to filter down to only hearings in the same general court. Running this once will overwrite and correct the existing links * test(hearings): Extracting the bill/hearing matching logic to a helper function for testability, adding unit tests to cover the new logic * Add Scrape Hearing Feature to Admin Page (#2021) * feature(admin): Add quick UI to scrape single hearing to admin page. This will make it easy to run one-offs in the future * chore(admin): Update local Docker instance to run ffmpeg, adding dummy secret for assemblyai to avoid error * fix(scraper): Use empty array instead of undefined as default for committeeChairs in hearing scraper - firebase does not like undefined values by default * chore(flag): Flip feature flag for hearings and transcriptions live for production (#2006) --------- Co-authored-by: mertbagt <[email protected]> Co-authored-by: J.I. Cruz <[email protected]> Co-authored-by: Jasmine Rose <[email protected]> Co-authored-by: Merritt Baggett <[email protected]> Co-authored-by: jicruz96 <[email protected]> Co-authored-by: Nathan E. Sanders <[email protected]> Co-authored-by: Huanfeng <[email protected]> Co-authored-by: Kimin Kim <[email protected]> Co-authored-by: Barry Moore II <[email protected]> Co-authored-by: Sam DeMarrais <[email protected]> Co-authored-by: Del <[email protected]> Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com> Co-authored-by: Nansamba Ssensalo <[email protected]> Co-authored-by: nssensalo <[email protected]>








Summary
This PR handles all remaining untranslate-able strings and fixes nearly all build warnings/errors.
Fixed build errors:
i18nextnon translate-able literal strings warnings.react-i18nextandnext-i18nextimports and configs.react-hooks/exhaustive-depslint errorsRemaining
The remaining bit of warnings will best be handled transiently in other PRs, namely:
jackspeakdependency mismatch: according to this commit, best handled by upgrading repo to yarn 3 laterScreenshots /Steps to Test
See screenshots in PR comments.
Known issues
Node engine warning?
The last warning is Vercel telling us it is using Node 22 instead of Node 20 because our package.json settings allow it to (
"engines": { "node": ">= 20"}). If that's not a problem then we can ignore the error but just wanted to flag it.